QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Choosing a Display Mode

After a video output component is chosen, the next step is to choose one of the component's available display modes. Your software does this by getting the QT atom container that contains descriptions of the available modes by calling the QTVideoOutputGetDisplayModeList function, traversing the atom container's contents using the QTFindChildByIndex function, examining the characteristics of each mode and setting aside any modes that are not appropriate for your software, and then optionally presenting a list of modes to the user to select from.

If your software does present a list of display modes to the user, it can obtain a string that describes each mode from the mode's kQTVOName atom with an ID of 1. The string doesn't include a leading length byte or a trailing null. Your software can determine the length of the string from the size of the atom.

When the mode has been chosen, your software calls the QTVideoOutputSetDisplayMode function to set the display mode.

Of display mode's characteristics, the most important is whether the mode can display the video data. This is determined by the availability of a decompressor component that takes the video data as input and converts it to the type of data, specified by the kQTVOPixelType atom, required by the video output device. If a video output device can directly display one of the supported QuickTime pixel formats, the necessary decompressor component is included in QuickTime. If special decompressor components are required for the video output device, such as JPEG or other decompressors that deliver data directly to the video output hardware without creating a new pixel format, these decompressor components are described in kQTVODecompressors atoms.

Contents of the Display Mode QT Atom Container

To obtain descriptions of the display modes, your software must use the functions for traversing QT atom containers described in "Movie Toolbox: Fundamentals."

At the root of the QT atom container returned by the QTVideoOutputGetDisplayModeList function are one or more atoms of type kQTVODisplayModeItem , each containing a definition of a display mode. Your software can traverse the display mode atoms by calling the QTFindChildByIndex function.

Within each kQTVODisplayModeItem atom are the following atoms:

By storing resolutions rather than an aspect ratio, QuickTime makes it easy for your software to compare values with values in QuickTime ImageDescription records. Your software can calculate the aspect ratio for the display mode by dividing the value for the horizontal resolution by the value for the vertical resolution.

Because kQTVODecompressors atoms are not required to have consecutive IDs, your software must use the QTFindChildByIndex function to iterate through the decompressors.

Within each kQTVODecompressors atom are one or more atoms:


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next